﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Scribd.Net
{
    /// <summary>
    /// Event arguments for Scribd events.
    /// </summary>
    public sealed class ScribdEventArgs : EventArgs
    {
        private int m_errorCode = 0;
        private string m_message = string.Empty;
        private Exception m_ex = null;

        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="errorCode">Error code returned by Scribd.</param>
        /// <param name="message">Message associated to the error code.</param>
        internal ScribdEventArgs(int errorCode, string message)
            : base()
        {
            m_errorCode = errorCode;
            m_message = message;
        }


        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="errorCode">Error code returned by Scribd.</param>
        /// <param name="message">Message associated to the error code.</param>
        /// <param name="ex">Any exception associated with the error.</param>
        internal ScribdEventArgs(int errorCode, string message, Exception ex)
            : this(errorCode, message)
        {
            m_ex = ex;
        }

        /// <summary>
        /// Error code returned by Scribd.
        /// </summary>
        public int ErrorCode { get { return m_errorCode; } }

        /// <summary>
        /// Message associated to the error code.
        /// </summary>
        public string Message { get { return m_message; } }

        /// <summary>
        /// Any exception associated with the error.
        /// </summary>
        public Exception Exception { get { return m_ex; } }
    }
}